Repository navigation
Conversation
MF6 runs `HEAD PRINT_FORMAT COLUMNS 10 WIDTH 11 DIGITS 4`, keeping the caller's edit descriptor, but the DFN says `optional false` for `format`, so `Simulation.load` raised a TypeError on mf6/test/test060_gms_ets. Correct this during generation, so it survives a sync from any MF6 release. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: to be reworked after a devtools DFN migration fix lands, which corrects this record, including requiring
columns,widthanddigits. This PR should then reduce to the regenerated files,KNOWN_PASSING, snapshots and tests, withoutdfn_fixes.py.Simulation.loadfails on an OC print format with no format word, which MF6 accepts.mf6/test/test060_gms_etswas the one model inmf6/testthat couldn't load:The DFN says
optional falseforformat, but MF6'sprint_formatreads whatever words followDIGITS, and without any keeps the caller's edit descriptor.utils/codegen/dfn_fixes.py, applied when generating classes and grammars, markingformatrecord'sformatoptional. A hand edit wouldn't surviveflopy4 mf6 sync, which regenerates from any release's DFNs203d72f0), so_contract.pyis unchanged. This affects GWF, GWT, GWE, CHF and OLF OC, and GWT IST. Regenerating without the fix reproduced the committed files exactly, so this diff is only the fixKNOWN_PASSING, with snapshotsA missing word stays missing when written. MF6 (
6.9.0.dev0+1469b358b9.dirty) runs the rewritten model to normal termination, with head and budget files byte-identical to the original's.Behavior changes
format_was first only because attrs sorts required fields first. All the fields are optional now, so the class follows the DFN and file order,columns, width, digits, format_:("GENERAL", 10, 12, 6)to(10, 12, 6, "GENERAL"). The old form raises aTypeErrorFormat("GENERAL", 10, 12, 6)is silently misread, and writesCOLUMNS GENERAL WIDTH 10 DIGITS 12 6. Nothing in the repo calls it this way, but keywords are saferPartial print formats no longer raise in flopy4, since they lacked the format word:
COLUMNS 10 WIDTH 11andCOLUMNS 10now load, and MF6 runs them to normal termination. MF6 ignores a format withoutCOLUMNS,WIDTHandDIGITS, without saying so, so the format is silently lostHEAD PRINT_FORMATnow loads, and MF6 rejects it.test_from_tokens_missing_required_raisesrelied on this raising, so it now usesNpf.RewetNot done
optional truein MF6. It's still worth doing, and this fix becomes a no-op once it lands, then can go when no supported release needs itcolumns,widthanddigits. MF6 doesn't reject input without them, but it needs all three to use the format, so requiring them would catch the partial and empty cases above. Existing tests rely on the looser forms, likefrom_tokens(["COLUMNS", "10", "exponential"]), and would need rewriting🤖 Generated with Claude Code